﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.model
{
    [XrmEntity("appointment", "activityid")]
    public class AppointmenMolde :BaseModel
    {
        [XrmFieldMapping("activityid", XrmAttributeType.UniqueIdentifier)]
        public System.Guid activityid { get; set; }

        /// <summary>
        /// 主题
        /// </summary>
        [XrmFieldMapping("subject", XrmAttributeType.String, true)]
        public string subject { get; set; }

        /// <summary>
        /// 拜访时间
        /// </summary>
        [XrmFieldMapping("scheduledstart", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> scheduledStart { get; set; }

        /// <summary>
        /// 拜访结束时间
        /// </summary>
        [XrmFieldMapping("scheduledend", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> scheduledEnd { get; set; }

        /// <summary>
        /// 医院
        /// </summary>
        [XrmFieldMapping("new_visitahospital", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_hospital", default(string))]
        public Nullable<System.Guid> new_visitahospital { get; set; }

        /// <summary>
        /// 拜访目的
        /// </summary>
        [XrmFieldMapping("new_visitpurpose", XrmAttributeType.String, true)]
        public string new_visitpurpose { get; set; }

        /// <summary>
        /// 签到地点
        /// </summary>
        [XrmFieldMapping("new_signinplace", XrmAttributeType.String, true)]
        public string new_signinplace { get; set; }

        /// <summary>
        /// 签到时间
        /// </summary>
        [XrmFieldMapping("new_signintime", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> new_signintime { get; set; }

        /// <summary>
        /// 拜访目的达成情况
        /// </summary>
        [XrmFieldMapping("new_descripion", XrmAttributeType.String, true)]
        public string new_descripion { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [XrmFieldMapping("statecode", XrmAttributeType.XrmOptionSetValue, true)]
        public int statecode { get; set; }

        /// <summary>
        /// 负责人id
        /// </summary>
        [XrmFieldMapping("ownerid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public System.Guid OwnerId { get; set; }

        [XrmFieldMapping("requiredattendees", XrmAttributeType.ActivityParty, true)]
        [ActivityParty("contact")]
        public IEnumerable<Guid> requiredattendees { get; set; }

    }
}
